<template>
	<el-card shadow="hover" header="网络测试">
		<el-button @click="netTest('10.98.34.192', 80)" size="default" class="ml-3" type="primary">
			<SvgIcon name="iconfont icon-step" />
			广西内网东软测试
		</el-button>
		<el-button @click="netTest('10.103.129.219', 8086)" size="default" class="ml-3" type="warning">
			<SvgIcon name="iconfont icon-step" />
			海南医保内网测试
		</el-button>
	</el-card>
	
</template>
<script lang="ts">
import { toRefs, reactive, defineComponent } from 'vue'
import { ElMessage } from 'element-plus'
import select from '/@/server/select'

export default defineComponent({
	name: 'ipAndPort',
	setup() {
		const state = reactive({
		})
		const netTest = async (ip: String, port: Number) => {
			let result = await select.telnet('10.98.34.192')
			ElMessage({
				showClose: true,
				duration: 5000,
				message: result,
				type: 'info',
			})
		}
		return {
			netTest,
			...toRefs(state),
		};
	}
});
</script>